<template>
	<view class="container-singin">
		<view class="main">
			<view class="bgc">
				<image src="@/static/index/signin-bgc.png" mode=""></image>
			</view>
			<view class="close" @tap="close">
				<image src="@/static/index/close.png" mode=""></image>
			</view>
			<view class="box ">
				<view class="content flex">
					<view class="box-item " v-for="(item,index) in list" :key="item.id">
						<view class="img">
							<image src="@/static/index/SignCurrency.png" mode="" v-if="!item.status"></image>
							<image src="@/static/index/SignNone.png" mode="" v-else></image>
						</view>
						<view class="text">{{item.status ? $t('home.name16'):item.name}}</view>
						<view class="num">+{{item.num}}</view>
					</view>
				</view>
				<view class="" style="margin: 30rpx auto;padding: 0 50rpx;">
					<u-button :text="$t('home.name17')" shape="circle" color="linear-gradient( 180deg, #1DF3FF 0%, #0EA3FF 100%)"
						@click="singin" throttleTime="1000"></u-button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "c-signIn",
		props: {
			list: {
				type: Array,
				require: []
			}
		},
		data() {
			return {

			};
		},
		methods: {
			close() {
				// 关闭弹窗
				this.$emit('close', false)
			},
			async singin() {
				this.$fun.showLoading()
				const res = await this.$fun.ajax.post('user/signin')
				uni.hideLoading()
				this.$fun.msg(res.msg)
				if (res.code == 1) {
					setTimeout(()=>{
					this.close()
					},800)
				}
			}
		}
	}
</script>

<style lang="scss">
	.container-singin {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		background-color: rgba(0, 0, 0, .5);
		z-index: 999;

		.main {
			width: 100%;
			height: 1180rpx;
			margin-top: 150rpx;
			position: relative;

			.bgc {
				width: 100%;
				height: 100%;
			}

			.close {
				position: absolute;
				bottom: 100rpx;
				left: 50%;
				transform: translateX(-50%);
				width: 52rpx;
				height: 52rpx;
			}

			.box {
				position: absolute;
				top: 350rpx;
				left: 15%;
				right: 15%;

				// width: 100%;
				.content {
					flex-wrap: wrap;
					align-items: flex-start;
				}

				.box-item {
					width: 25%;
					text-align: center;
					margin: 20rpx 0;

					.img {
						width: 60rpx;
						height: 60rpx;
						margin: 0 auto;
					}

					.text {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 24rpx;
						color: #232323;
						// line-height: 48rpx;
						margin: 10rpx 0;
					}

					.num {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 24rpx;
						color: #232323;
						line-height: 28rpx;
					}
				}
			}
		}
	}
</style>